<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  
  <title>树莓派安装 ROS | ChenBlue | 飞雪连天射白鹿 笑书神侠倚碧鸳</title>

  
  <meta name="author" content="ChenBlue">
  

  
  <meta name="description" content="学习笔记">
  

  
  
  <meta name="keywords" content="ROS">
  

  <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">

  <meta property="og:title" content="树莓派安装 ROS"/>

  <meta property="og:site_name" content="ChenBlue"/>

  
  <meta property="og:image" content="/blog/favicon.ico"/>
  

  <link href="/blog/favicon.ico" rel="icon">
  <link rel="alternate" href="/blog/atom.xml" title="ChenBlue" type="application/atom+xml">
  <link rel="stylesheet" href="/blog/css/style.css" media="screen" type="text/css">
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
<div class="blog">
  <div class="content">

    <header>
  <div class="site-branding">
    <h1 class="site-title">
      <a href="/blog/">ChenBlue</a>
    </h1>
    <p class="site-description">飞雪连天射白鹿 笑书神侠倚碧鸳</p>
  </div>
  <nav class="site-navigation">
    <ul>
      
    </ul>
  </nav>
</header>

    <main class="site-main posts-loop">
    <article>

  
    
    <h3 class="article-title"><span>树莓派安装 ROS</span></h3>
    
  

  <div class="article-top-meta">
    <span class="posted-on">
      <a href="/blog/2021/06/26/树莓派安装 ROS/" rel="bookmark">
        <time class="entry-date published" datetime="2021-06-26T14:19:03.000Z">
          2021-06-26
        </time>
      </a>
    </span>
  </div>


  

  <div class="article-content">
    <div class="entry">
      
        <p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/guochaoxxl/p/11617618.html">参考链接</a></p>
<h1 id="Install-Dependecies-and-Download-the-Packages"><a href="#Install-Dependecies-and-Download-the-Packages" class="headerlink" title="Install Dependecies and Download the Packages"></a>Install Dependecies and Download the Packages</h1><pre class="language-none"><code class="language-none">sudo sh -c &#39;echo &quot;deb http:&#x2F;&#x2F;packages.ros.org&#x2F;ros&#x2F;ubuntu $(lsb_release -sc) main&quot; &gt; &#x2F;etc&#x2F;apt&#x2F;sources.list.d&#x2F;ros-latest.list&#39;
sudo apt-key adv --keyserver &#39;hkp:&#x2F;&#x2F;keyserver.ubuntu.com:80&#39; --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential  cmake</code></pre>

<pre class="language-none"><code class="language-none">sudo rosdep init
rosdep update</code></pre>
<p>rosdep init 会报错。原因是网址被墙了 <a target="_blank" rel="noopener" href="https://www.cnblogs.com/jasonchan1202/p/12929308.html">解决的办法是</a></p>
<pre class="language-none"><code class="language-none">sudo vi &#x2F;etc&#x2F;hosts 
151.101.84.133 raw.githubusercontent.com &#x2F;&#x2F;最后一行添加
sudo rosdep init
rosdep update</code></pre>
<p>When that’s done let’s create a dedicated catkin workspace for building ROS and move to that directory.</p>
<pre class="language-none"><code class="language-none">mkdir ~&#x2F;ros_catkin_ws
cd ~&#x2F;ros_catkin_ws</code></pre>

<pre class="language-none"><code class="language-none">rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar &gt; melodic-desktop-wet.rosinstall

wstool init -j8 src melodic-desktop-wet.rosinstall</code></pre>
<p>If wstool init fails or is interrupted, you can resume the download by running:</p>
<p><code> wstool update -j4 -t src</code></p>
<h1 id="Fix-the-Issues"><a href="#Fix-the-Issues" class="headerlink" title="Fix the Issues"></a>Fix the Issues</h1><pre class="language-none"><code class="language-none">mkdir -p ~&#x2F;ros_catkin_ws&#x2F;external_src
cd ~&#x2F;ros_catkin_ws&#x2F;external_src
wget    http:&#x2F;&#x2F;sourceforge.net&#x2F;projects&#x2F;assimp&#x2F;files&#x2F;assimp-3.1&#x2F;assimp-3.1.1_no_test_models.zip&#x2F;download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install
cd ..
rosdep install --from-paths src --ignore-src --rosdistro melodic -y</code></pre>

<p>Let’s also install OGRE for rviz</p>
<pre class="language-none"><code class="language-none">sudo apt-get install  libogre-1.9-dev</code></pre>

<h1 id="Build-and-Source-the-Installation"><a href="#Build-and-Source-the-Installation" class="headerlink" title="Build and Source the Installation"></a>Build and Source the Installation</h1><p><code>sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j2</code></p>
<pre class="language-none"><code class="language-none">echo &quot;source &#x2F;opt&#x2F;ros&#x2F;melodic&#x2F;setup.zsh&quot; &gt;&gt; ~&#x2F;.zshrc</code></pre>
<h1 id="Install-RPLIDAR-ROS-Package"><a href="#Install-RPLIDAR-ROS-Package" class="headerlink" title="Install RPLIDAR ROS Package"></a>Install RPLIDAR ROS Package</h1>
      
    </div>

  </div>

  <div class="article-footer">
    <div class="article-meta pull-left">

    
      

    <span class="post-categories">
      <i class="icon-categories"></i>
        <a href="/blog/categories/ROS-学习笔记/">ROS 学习笔记</a>
    </span>
    

    
    

    <span class="post-tags">
      <i class="icon-tags"></i>
        <a href="/blog/tags/ROS/">ROS</a>
    </span>
    

    </div>

    
  </div>
</article>

  









    </main>

    <footer class="site-footer">
  <p class="site-info">
    Proudly powered by <a href="https://hexo.io/" target="_blank">Hexo</a> and
    Theme by <a href="https://github.com/CodeDaraW/Hacker" target="_blank">Hacker</a>
    </br>
    
    &copy; 2023 ChenBlue
    
  </p>
</footer>
    
    
  </div>
</div>
</body>
</html>